package com.mad.game.backend.entities;

public abstract class GameEntityProperties {

	private int health ;
	private int jumpHeight ; 
	private int speed ; 
	private boolean dead = false ; 

	public int getHealth() {
		return health;
	}

	public void setHealth(int health) {
		this.health = health;
	} 
	
	public boolean isDead() {
		return dead;
	}

	public void setDead(boolean isDead) {
		this.dead = isDead;
	}

	public int getJumpHeight() {
		return jumpHeight;
	}

	public void setJumpHeight(int jumpHeight) {
		this.jumpHeight = jumpHeight;
	}

	public int getSpeed() {
		return speed;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	public GameEntityProperties(int health, int jump, int speed) {
		this.setHealth(health);
		this.setJumpHeight(jump);
		this.setSpeed(speed);
	}

	public void changeHealth(int delta){
		this.health += delta ; 
		if(health <= 0)
			this.die();
	}
	
	public void die(){
		this.setDead(true);
	}
	
	/* 
	 * subclasses 
	 */
	public static class PlayerEntityProperties extends GameEntityProperties{
		public PlayerEntityProperties() {
			super(10, 20, 10);
		}
	}
	public static class EnemyEntityProperties extends GameEntityProperties{
		public EnemyEntityProperties() {
			super(5, 15, 10);
		}
	}
}
